namespace System;
/// <summary>
/// 
/// </summary>
public static class RequiresEx
{
    [Pure, DebuggerStepThrough]
    internal static void ValidState(bool condition)
    {
        if (!condition)
        {
            throw new InvalidOperationException();
        }
    }
    [Pure, DebuggerStepThrough]
    internal static void ValidState(bool condition, string message)
    {
        if (!condition)
        {
            throw new InvalidOperationException(message);
        }
    }
    [Pure, DebuggerStepThrough]
    internal static void ValidState(bool condition, string unformattedMessage, params object[] args)
    {
        if (!condition)
        {
            throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, unformattedMessage, args));
        }
    }
    [Pure, DebuggerStepThrough]
    internal static void NotNullSubtype<T>(Type type, string parameterName)
    {
        Requires.NotNull(type, parameterName);
        Requires.That(typeof(T).IsAssignableFrom(type), parameterName, "", typeof(T).FullName!, type.FullName!);
    }
    [Pure, DebuggerStepThrough]
    internal static void Format(bool condition, string message)
    {
        if (!condition)
        {
            throw new FormatException(message);
        }
    }
    [Pure, DebuggerStepThrough]
    internal static void Support(bool condition, string message)
    {
        if (!condition)
        {
            throw new NotSupportedException(message);
        }
    }
}
